If for some reason GOG version of X4 wont open in debug mode just make a shortcut of x4.exe with below parameters:

-debug script -logfile x4.log